PopupWidgetScreen

open class PopupWidgetScreen(title: Text) : Screen, PopupParentElement

A base screen that supports popup widgets. See PopupParentElement for documentation on underlying implementations.

To add and remove popups from this screen, call PopupWidget.push and PopupWidget.pop

For most intents and purposes, treat this screen like a standard Screen, with a couple caveats:

  • Make sure to call super on resize, render, and keyPressed otherwise popup functionality will break

  • call super.render AFTER any custom rendering, or popups may appear improperly below custom elements

  • call super.keyPressed BEFORE custom keypresses, otherwise clicks may improperly propagate through popups to elements underneath them

Author

fzzyhmstrs

Since

0.2.0

Parameters

title

Text, the screen title

See also

Constructors

Link copied to clipboard
constructor(title: Text)

Properties

Link copied to clipboard
Link copied to clipboard
@Nullable
@get:Nullable
var focused: Element?
Link copied to clipboard
var height: Int
Link copied to clipboard
open override var justClosedWidget: Boolean

Boolean prevents mouseReleased from triggering on the Popup or Widget underneath the active popup if it's closed on mouseClicked

Link copied to clipboard
open override var lastSelected: Element?
Link copied to clipboard
open override val popupWidgets: LinkedList<PopupWidget>

A stack for holding popupwidgets while allowing for easy list iteration as needed. For rendering this stack should be traversed in reverse order, which LinkedList makes easy with descendingIterator

Link copied to clipboard
var width: Int

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun blur()
Link copied to clipboard
open override fun charTyped(chr: Char, modifiers: Int): Boolean
Link copied to clipboard
open override fun children(): MutableList<out Element>
Link copied to clipboard
open fun close()
Link copied to clipboard
open fun filesDragged(paths: MutableList<Path>)
Link copied to clipboard
@Nullable
open override fun getFocusedPath(): GuiNavigationPath?
Link copied to clipboard
@Nullable
open fun getMusic(): MusicSound?
Link copied to clipboard
open fun getNarratedTitle(): Text
Link copied to clipboard
open override fun getNavigationFocus(): ScreenRect
Link copied to clipboard
Link copied to clipboard
@Nullable
open override fun getNavigationPath(navigation: GuiNavigation): GuiNavigationPath?
Link copied to clipboard
open fun getTextRenderer(): TextRenderer
Link copied to clipboard
open fun getTitle(): Text
Link copied to clipboard
open fun handleTextClick(@Nullable style: Style?): Boolean
Link copied to clipboard
open fun hoveredElement(mouseX: Double, mouseY: Double): Optional<Element>
Link copied to clipboard
fun init(client: MinecraftClient, width: Int, height: Int)
Link copied to clipboard
open override fun isFocused(): Boolean
Link copied to clipboard
open override fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean
Link copied to clipboard
open fun mouseMoved(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean
Link copied to clipboard
open fun narrateScreenIfNarrationEnabled(onlyChangedNarrations: Boolean)
Link copied to clipboard
open fun onDisplayed()
Link copied to clipboard
open override fun popLast()
Link copied to clipboard
open override fun pushLast()
Link copied to clipboard
open fun refreshNarrator(previouslyDisabled: Boolean)
Link copied to clipboard
open fun removed()
Link copied to clipboard
open override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open fun renderBackground(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open fun renderInGameBackground(context: DrawContext)
Link copied to clipboard
fun renderWithTooltip(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open override fun resize(client: MinecraftClient, width: Int, height: Int)
Link copied to clipboard
open override fun setFocused(focused: Boolean)
Link copied to clipboard
open fun setPopup(widget: PopupWidget?)
Link copied to clipboard
open fun setTooltip(tooltip: MutableList<OrderedText>)
open fun setTooltip(tooltip: Text)
open fun setTooltip(tooltip: MutableList<OrderedText>, positioner: TooltipPositioner, focused: Boolean)
open fun setTooltip(tooltip: Tooltip, positioner: TooltipPositioner, focused: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun shouldPause(): Boolean
Link copied to clipboard
open fun tick()
Link copied to clipboard
open fun updateNarrator()